{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo web_url('news/noticeset/smslist')}">短信模板</a></li>
</ul>
<div class="app-content">
	<div class="app-filter">
		<div class="filter-action">
			<a href="{php echo web_url('news/noticeset/smsadd');}" class="btn btn-primary">添加模板</a>
		</div>
	</div>
	<div class="app-table-list">
		<div class="table-responsive">
			<table class="table table-hover">
				<thead>
					<tr>
						<th class="text-center">模板名称</th>
						<th class="text-center">服务商</th>
						<th class="text-center">状态</th>
						<th class="text-center">操作</th>
					</tr>
				</thead>
				<tbody>
					{loop $list $item}
						<tr class="text-center">
							<td>{$item['name']}</td>
							<td>
								{if $item['type']=='aliyun'}
								<span class="label label-primary">阿里云</span>
								{elseif $item['type']=='dayu'}
								<span class="label label-success">阿里大于</span>
								{elseif $item['type']=='emay'}
								<span class="label label-warning">亿美软通</span>
								{/if}
							</td>
							<td>
								<span class="label {if !empty($item['status'])}label-success{else}label-default{/if}">
									{if !empty($item['status'])}开启{else}关闭{/if}
								</span>
							</td>
							<td>
								<a class='btn btn-default  btn-sm' href="{php echo web_url('news/noticeset/smsedit', array('id' => $item['id']))}"><i class='fa fa-edit'></i> 编辑</a>
								<a href="javascript:;" class='btn btn-default  btn-sm js-dele'  data-id="{$item['id']}" ><i class='fa fa-trash'></i> 删除</a>
							</td>
						</tr>
					{/loop}
				</tbody>
			</table>
		</div>
		<div class="app-table-foot clearfix">
			<div class="pull-left">

			</div>
			<div class="pull-right">
				{$pager}
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$('.js-dele').click(function(){
		var id = $(this).attr("data-id");
		var url =  "{php echo web_url('news/noticeset/dele')}" + "id="+id;
		$.ajax({
	        type: "POST",
	        url:url,
	        dataType:'json',
	        success: function(data) {
	        	layer.msg(data.message);
	        	location.href = "{php echo web_url('news/noticeset/smslist')}";
	        }
	    });
	})
</script>
{php include wl_template('common/footer');}
